//
//  ExhibitionObject.m
//  HAODE
//
//  Created by LiYinDi on 16/4/8.
//  Copyright © 2016年 reabam.com. All rights reserved.
//

#import "ExhibitionObject.h"
#import "ExhibitionCategoryViewController.h"
 
@implementation ExhibitionObject
//一下方法都是只是打了个log 等会看log 以及参数能对上就说明js调用了此处的iOS 原生方法
-(void)go:(NSString *)string1 List:(NSString *)message2
{
   // 使用下面GCD代码（使用主线程更新UI）即可去掉警报This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes.  This will cause an exception in a future release.
//    NSLog(@"uuuuuuuuuuu111111");
    dispatch_async(dispatch_get_main_queue(), ^{
        if ([self.delegate respondsToSelector:@selector(itemClick:)]) {
            
            [self.delegate itemClick:message2];
        }
        
    });
}
-(void)go:(NSString *)title Common:(NSString *)url H5:(NSString *)shareType Page:(NSString *)contentId{

    dispatch_async(dispatch_get_main_queue(), ^{
        if ([self.delegate respondsToSelector:@selector(CommonH5Page:url:shareType:contentId:)]) {
            
            [self.delegate CommonH5Page:title url:url shareType:shareType contentId:contentId];
            
            
        }
        
    });



}

-(void)go:(NSString *)string1 PageItem:(NSString *)message2
{

    
//     NSLog(@"string1==>>==%@",string1);
//    NSLog(@"go:(NSString *)string1 PageItem:(NSString *)message2");
    dispatch_async(dispatch_get_main_queue(), ^{
        if ([self.delegate respondsToSelector:@selector(pageItem:exhibitionID:)]) {
            
            [self.delegate pageItem:message2 exhibitionID:string1 ];
        }
        
    });

}
-(void)go:(NSString *)itemID Detail:(NSString *)Url
{
//    NSLog(@"DetailUrl==>>==%@",Url);
    dispatch_async(dispatch_get_main_queue(), ^{
        if ([self.delegate respondsToSelector:@selector(productDetail:Url:)]) {
            
            [self.delegate productDetail:itemID Url:Url];
        }
        
    });

}

-(NSString *)getServerUrl{


    
    NSUserDefaults *user = [NSUserDefaults standardUserDefaults];
    NSString *getServerUrl = [user objectForKey:@"serverAddress"];

    
    return getServerUrl;
    
}
-(NSString *)getVersion

//[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"]
{
//    NSUserDefaults *user = [NSUserDefaults standardUserDefaults];
    NSString *getVersion =  [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
   NSLog(@"tokenId^^===%@",getVersion);
    return getVersion;
}

-(NSString *)getTokenId
{
    NSUserDefaults *user = [NSUserDefaults standardUserDefaults];
    NSString *tokenId = [user objectForKey:@"tokenId"];
    NSLog(@"tokenId^^===%@",tokenId);
    return tokenId;
}
-(NSString *)getCompanyId
{
    NSUserDefaults *user = [NSUserDefaults standardUserDefaults];
    NSString *companyId = [user objectForKey:@"companyId"];
       NSLog(@"companyId^^===%@",companyId);
    return companyId;
}
 -(NSString *)getGroupId
{
    NSUserDefaults *user = [NSUserDefaults standardUserDefaults];
    NSString *groupID = [user objectForKey:@"groupId"];
    NSLog(@"groupID^^===%@",groupID);
    return groupID;
}
@end
